package com.smarthome.domain.mobile;

import java.io.Serializable;

public class MobileResponse<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private MobileCodeEnum mobileCodeObj;
    private T data;
    private Object[] objs;

    public String getCode() {
        return null == mobileCodeObj ? "ok" : mobileCodeObj.getCode();
    }

    public String getMsg() {
        return null == mobileCodeObj ? "" : String.format(mobileCodeObj.getMsg(), objs);
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setMobileCodeObj(MobileCodeEnum ipcCodeObj, Object... objs) {
        this.mobileCodeObj = ipcCodeObj;
        this.objs = objs;
    }

}
